﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp8
{
    internal class Program
    {
        static void Main(string[] args)
        {
            GenericList<int> genericList = new GenericList<int>();
            Random random = new Random();
            for (int i=0;i<10;i++)
            {
                int randomNumber = random.Next(1, 101);
                genericList.Add(randomNumber);
            }
            int max = 0, min = 100, add = 0;
            Action<int> action = m =>
            {
                Console.WriteLine($"{m}");
                max = (max < m) ? m : max;
                min = (min > m) ? m : min;
                add += m;
            };
            Console.WriteLine($"链表元素：");
            genericList.ForEach(action);
            Console.WriteLine($"链表元素最大值：{max}");
            Console.WriteLine($"链表元素最小值：{min}");
            Console.WriteLine($"链表元素和为：{add}");
        }
    }
}
